Assignemnt #63 and 61st program
Code
///Name: Derrick Andreasen
///Period: 7
///Program name: 61st Program
///File name: Sixt1Prog.java
///Date Finished:11/16/2015
import java.util.Scanner;
public class Sixt1Prog
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int n = 0, amount;
System.out.println( "Type in a message, and I'll display it several times." );
System.out.print( "Message: " );
String message = keyboard.nextLine();
System.out.println( "How many times: " );
amount = keyboard.nextInt();
while ( n < amount )
{
System.out.println( (n*10) + ". " + message );
n++; //removing this makes the program go on endlessly
}
}
}
Picture of the output